package com.hushao.lims.weblims.repository;

import com.hushao.lims.weblims.domain.EquipmentInfo;
import com.hushao.lims.weblims.domain.EquipmentRepertory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author 930588706
 * @date 18/1/20
 */
public interface EquipmentRepertoryRepository extends JpaRepository<EquipmentRepertory,Long> {
    /**
     * 根据器材名称模糊查询数量大于0的耗材（分页）
     * @param count
     * @param equipmentName
     * @param pageable
     * @return
     */
    Page<EquipmentRepertory> findByEquipmentCountGreaterThanAndEquipmentInfo_EquipmentNameLike(int count, String equipmentName, Pageable pageable);

    /**
     * 根据器材查询库存
     * @param equipmentInfo
     * @return
     */
    EquipmentRepertory findByEquipmentInfo(EquipmentInfo equipmentInfo);
}
